
import { Module } from 'vuex'
import { GloableState } from '../index'
import { routes } from '@/router/index'
import { RouteRecordRaw } from 'vue-router'

export interface PermissionState {
  routes:RouteRecordRaw[]
}

const state = <PermissionState> {
  routes: []
}

const mutations = {
  SET_PROMISSION: (state:PermissionState, payload:any) => {
    state.routes = routes
  }
}

const actions = {
}

const permission: Module<PermissionState, GloableState> = {
  namespaced: true,
  state,
  mutations,
  actions
}

export default permission
